package protocol.registration;

import java.io.DataOutputStream;
import java.io.IOException;

import helpers.Client;

public class ServerRegistrationResponse {

	private Client[] m_hisClients;
	private Client[] m_otherClients;
	
	public ServerRegistrationResponse(Client[] hisClients, Client[] otherClients)
	{
		m_hisClients = hisClients;
		m_otherClients = otherClients;
	}
	
	
	public DataOutputStream write(DataOutputStream dos) throws IOException
	{
		dos.writeInt(m_hisClients.length);
		for(int i = 0 ; i < m_hisClients.length ; i++)
			m_hisClients[i].write(dos);
		
		dos.writeInt(m_otherClients.length);
		for(int i = 0; i < m_otherClients.length; i++)
			m_otherClients[i].write(dos);
		
		return dos;
		
	}
	
}
